package com.badger.openfeign.api;

import org.springframework.stereotype.Component;

import feign.hystrix.FallbackFactory;

@Component
public class DemoApiFallbackFactory implements FallbackFactory<DemoFeignApi> {

    @Override
    public DemoFeignApi create(Throwable cause) {

        return new DemoFeignApi() {
            @Override
            public String demo() {
                return "断路器生效";
            }
        };
    }
}
